#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
char* my_strtok(char* arr,const char* arr2) {
	static char* tmp = NULL;
	if (arr != NULL)
		tmp = arr;
	char* tmp2 = tmp;
	while (*tmp2)
	{
		const char* tmp3 = arr2;
		while (*tmp3)
		{
			if ((int)*tmp2 == (int)*tmp3)
			{
				char* tmp4 = tmp;
				*tmp2 = '\0';
				tmp = tmp2 + 1;
				return tmp4;
			}
			tmp3++;
		}
		tmp2++;
	}
	char* tmp4 = tmp;
	tmp = NULL;
	return tmp4;
	if (tmp == NULL)
		return NULL;
}
int main()
{
	char arr[] = "abc,def.ghi,jkl.sdef.s.fefse.re.rw.e.rf.sdfs.efr.ef.asda.da.w.da.sf.s.fas.f.a";
	char arr2[] = ".,";
	for (char* s = my_strtok(arr, arr2); s != NULL; s = my_strtok(NULL, arr2))
		printf("%s\n", s);
}